Skip to content

fix: emit tool_call in generated opencode.json model entries - #35

Merged
developerz-ai[bot] merged 1 commit into
mainfrom
dz/re-check-the-generated-opencode-json-against-the--686da5ed
Nov 9, 2026
Merged

developerz-ai[bot] merged 1 commit into
mainfrom
dz/re-check-the-generated-opencode-json-against-the--686da5ed

Conversation

@developerz-ai

@developerz-ai developerz-ai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

What

The model-level "tools": true is not a field in the opencode v1 provider-model schema (tool_call is) and was silently dropped. Emit tool_call: true in the local and remote configs. The rest of the shape (provider/npm/options, autoupdate, top-level tools block) is valid in opencode v1.18.21 and normalized by 2.x. Record the schema reference in the generator comment and pin the shape in tests.

Acceptance

  • Generated local and remote opencode.json contain model-level "tool_call": true and no model-level "tools": true
  • Top-level tools block (built-ins disabled) and provider block (npm, options.baseURL/timeout/chunkTimeout, limit) are unchanged
  • Generated config contains no v2-native-only keys (providers, permissions, agents, commands)
  • bash tests/opencode_config_test.sh and bash tests/test_provider.sh pass; bash -n lib/*.sh passes
  • PR description records schema reference: opencode v1.18.21 config.ts + core/src/v1/config/provider.ts, and opencode.ai/docs/migrate-v1/

Changes

  • lib/opencode.sh (edit) — In BOTH generators (local heredoc ~:290-292, remote ~:562-564) replace model-level "tools": true with "tool_call": true: v1 Model schema (packages/core/src/v1/config/provider.ts) has tool_call, and unknown keys are silently dropped. Keep provider/npm/options, autoupdate:false, share and top-level tools block unchanged (valid in v1; v2 normalizes them). Update comment ~:219 to record schema reference (opencode v1.18.21 config.ts/provider.ts; opencode.ai/docs/migrate-v1/). Do NOT emit v2-native providers/permissions keys.
  • tests/opencode_config_test.sh (edit) — Add offline assertions on generated local and remote config: model has tool_call:true and no model-level tools:true; top-level tools block still disables the built-ins; provider has npm, options.baseURL/timeout/chunkTimeout; no v2-only top-level keys (providers, permissions, agents, commands). Assert generated output, never edit existing fixtures to match. Read file first and follow its style; unset per-case env.

Verification

No check command was found for this repository, so no gate ran before the commit.

What the editors ran to see the change working, and what they saw:

  • bash -n lib/opencode.sh && bash tests/opencode_config_test.sh (core): 108 passed, 0 failed. This includes new section 9 'schema local' and 'schema remote' checks: tool_call true, no model-level tools, npm/options/limit kept, top-level built-ins disabled, no v2-only keys.

Notes

Premises of the request the team disproved:

  • Request says installer refuses opencode 2.x: nothing does. bin/mini:114-116 installs via curl opencode.ai/install with no version check; lib/doctor.sh:16 only prints --version.
  • Model-level "tools": true is not a v1 schema key (v1 has tool_call); unknown keys are ignored (ConfigParse.schema onExcessProperty:ignore). It is the one genuinely dead key.
  • Top-level tools, autoupdate, share, provider npm/options.timeout/chunkTimeout are NOT deprecated in v1.18.21 (tools becomes permissions). migrate-v1 says v2 normalizes v1 syntax quietly, so trimming and provider block keep working; v2 shape would be ignored by v1, so do not emit it.
  • Unverified: I did not run opencode; resolved-config print (e.g. OPENCODE_CONFIG=... opencode debug config) needs a box with opencode. v1 default for tool_call on custom models also unconfirmed.

🤖 Opened by developerz.ai for task tsk_686da5ed67418b4a3a2f6a8123831414 on developerz-ai/mini.

Raised automatically by the raw_task_triage lane.

🤖 developerz.ai, an automated agent, not a human — this PR is one slice of a stacked plan.
Dispatched automatically by the raw_task_triage lane
Model claude-sonnet-5-5 on router.ai.developerz.ai via native, funded by account_key
Ran on box hv-dedicated-ci-2
Cost unknown: no list price on record for claude-sonnet-5-5 on router.ai.developerz.ai
Run timeline run_78b1fcad926249559264e973c36bb195
Part 1/1 of plan rtk_8fedced73f164a5fa97d18c46c9dcb12

The model-level "tools": true is not a field in the opencode v1 provider-model schema (tool_call is) and was silently dropped. Emit tool_call: true in the local and remote configs. The rest of the shape (provider/npm/options, autoupdate, top-level tools block) is valid in opencode v1.18.21 and normalized by 2.x. Record the schema reference in the generator comment and pin the shape in tests.

Dz-Task-Id: tsk_686da5ed67418b4a3a2f6a8123831414
@developerz-ai developerz-ai Bot added the dz/fleet-pr Opened by developerz.ai, an automated agent, from a fleet run. label Nov 9, 2026
@developerz-ai

developerz-ai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor Author

Re-check the generated opencode.json against the opencode schema the installer permits

Work landed on #35 — watching it toward merge.

2h05m · 67 tool calls

Sessions: coding run


🤖 developerz.ai, an automated agent, not a human — hv-dedicated-ci-2 (developerz-ai[bot]) · model claude-sonnet-5-5 on router.ai.developerz.ai

@developerz-ai developerz-ai Bot added dz/model:claude-sonnet-5-5 developerz.ai: model that wrote this bot PR. dz/provider:router.ai.developerz.ai developerz.ai: provider that served this bot PR. labels Nov 9, 2026
@developerz-ai

developerz-ai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Reviewed — nothing blocking

0 actionable comment(s) · grounded on your code

⏱ 1m 57s wall clock · deepseek-v4.1-flash via router · 3 model call(s) · 21,958 output token(s)

🤖 developerz.ai — automated review, running on your model and your box.

@developerz-ai developerz-ai Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review summary — 2 file(s), 0 finding(s).

Replaces the silently-dropped model-level "tools": true with "tool_call": true in both config writers and pins it with section-9 assertions on freshly generated local and remote output. The new checks would fail on the pre-change generator, so the oracle is real; no defect found.

🤖 developerz.ai review — automated, running on your model and your box. What is this? · Reviewed by router/deepseek-v4.1-flash on box hv-dedicated-ci-0 — 103k in / 22k out over 3 calls, on your flat-rate plan: no per-token charge (~$0.03 at list price).

@developerz-ai
developerz-ai Bot merged commit 74d9a12 into main Nov 9, 2026
3 checks passed
@developerz-ai
developerz-ai Bot deleted the dz/re-check-the-generated-opencode-json-against-the--686da5ed branch November 9, 2026 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dz/fleet-pr Opened by developerz.ai, an automated agent, from a fleet run. dz/model:claude-sonnet-5-5 developerz.ai: model that wrote this bot PR. dz/provider:router.ai.developerz.ai developerz.ai: provider that served this bot PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants